package com.example.demo.controller;

import com.alibaba.fastjson.JSONArray;
import com.example.demo.config.annotation.Token;
import com.example.demo.model.Hello;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("abc")
public class HelloController {
    @Autowired
    private Hello hello;

    @RequestMapping("")
    public String index(){
        return "h";
    }

    @RequestMapping("helloWorld")
    public String index1(){
        return "hello world!";
    }

    @Token
    @RequestMapping("hello1")
    public Hello sample(){
        return hello;
    }

    @RequestMapping("test")
    public JSONArray a1(){
        return new JSONArray();
    }

}
